package com.edu.study.normal;

import lombok.Data;

import java.util.List;
import java.util.Objects;

/**
 * @Author: wuzs
 * @Date: 2019/11/25 0:27
 */
@Data
public class Menu {
    private int id;
    private int parentId;
    private String title;
    private List<Menu> children;
    @Override
    //重写equals
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Menu menu = (Menu) o;
        return Objects.equals(id, menu.id);
    }

    @Override
    public int hashCode(){
        return Objects.hash(id);
    }
}
